package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface UserDao {
    User findByUsername(String username);

    Page<User> findByCondition(String queryString);

    int findUserCountByUsername(String username);

    void add(User user);

    List<Integer> findRolesByUserId(Integer userId);

    void deleteAssocication(Integer userId);

    void setUserAndRole(Map<String, Integer> map);

    void deleteUserRole(Integer id);

    void deleteUser(Integer id);

    User findUserById(Integer id);

    void update(User user);

    String findPasswordByUsername(String username);

    void updatePassword(@Param("username")String username, @Param("newPassword")String newPassword);
}
